﻿package we3d.math
{
	public class Vector3d 
	{
		public function Vector3d (ax:Number=0, ay:Number=0, az:Number=0) {
			x = ax;
			y = ay;
			z = az;
		}
		
		public var x:Number;
		public var y:Number;
		public var z:Number;
		
		public function assign( ax:Number, ay:Number, az:Number) :void {
			x = ax;
			y = ay;
			z = az;
		}
		
		/*
		public function toString (dp:int=-1) :String {
			if(dp > 0) {
				return x.toFixed(dp) + ", "  + y.toFixed(dp) + ", " + z.toFixed(dp); 
			}else{
				return x+", "+y+", "+z;
			}
		}*/
		
		/*
		public function clone () :Vector3d {
			return new Vector(x,y,z);
		}*/
		
		/*
		public static function assignVector(v:Vector3d, newVect:Vector3d) :void {
			v.x = newVect.x;
			v.y = newVect.y;
			v.z = newVect.z;
		}
		*/
		
		/*
		public static function normalize (v:Vector3d) :void {
			var m:Number = Math.sqrt(v.x*v.x + v.y*v.y + v.z*v.z);
			v.x /= m;
			v.y /= m;
			v.z /= m;
		}*/
		
		/*
		public static function minus (v1:Vector3d, v2:Vector3d, rv:Vector3d) :void {
			rv.x = v1.x - v2.x;
			rv.y = v1.y - v2.y;
			rv.z = v1.z - v2.z;
		}*/
		
		/*
		public static function dot (v1:Vector3d, v2:Vector3d) :Number {			
			return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
		}*/
		
		/*
		public static function cross (v1:Vector3d, v2:Vector3d, rv:Vector3d) :void {
			rv.x = v1.y * v2.z - v1.z * v2.y;
			rv.y = v1.z * v2.x - v1.x * v2.z;
			rv.z = v1.x * v2.y - v1.y * v2.x;
		}*/
		
		/*
		public static function magnitude (v:Vector3d) :Number {
			return Math.sqrt(v.x*v.x + v.y*v.y + v.z*v.z); 
		}*/
		
		/*
		public static function invert (v:Vector3d) :void {
			v.x = -v.x;
			v.y = -v.y;
			v.z = -v.z;
		}*/
		
		/*
		public static function plus (v1:Vector3d, v2:Vector3d, rv:Vector3d) :void {
			rv.x = v1.x + v2.x;
			rv.y = v1.y + v2.y;
			rv.z = v1.z + v2.z;
		}
		*/
		
		/*
		public static function distanceTo (v1:Vector3d, v2:Vector3d) :Number {
			var a:Number = v2.x-v1.x;
			var b:Number = v2.y-v1.y;
			var c:Number = v2.z-v1.z;
			
			return Math.sqrt(a*a+b*b+c*c);
		}
		*/
		
	}
	
}
